package com.icw.resource.workflow.entity;

import javax.persistence.*;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import com.icw.basis.BasePoEntity;

import lombok.*;

@Getter
@Setter
@Entity
public class WorkActivityPropInstance extends BasePoEntity {

	private static final long serialVersionUID = 1L;

	@Column(columnDefinition = TEXT_COLUMN, nullable = false)
	private String value;

	@Fetch(FetchMode.JOIN)
	@ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
	@JoinColumn(nullable = false)
	private WorkActivityInstance activityInstance;

	@Fetch(FetchMode.JOIN)
	@ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.EAGER)
	@JoinColumn(nullable = false)
	private WorkActivityPropDefinition activityPropDefinition;
}
